package com.bw.zhuangao5___day002.Fragment.Home.Fragment3;

import com.bw.mvp.M.BannerModel;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * create by ertu
 * create on 2021/9/24
 * description
 */
public class ClassModel extends BannerModel implements ClassContion.resmodel {
    @Override
    public void getresmodel( ClassCallbck classCallbck) {
        ClassOkhttps.getClassOkhttps().retrofit().create(ClassAPi.class).getjavalclss()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(new Observer<JavaClass>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(JavaClass javaClass) {
                        List<JavaClass.ResultBean.DataBean> verticalBeanList = javaClass.getResult().getData();
                        classCallbck.suueclass(verticalBeanList);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }
}
